app.utils = {
	init : function() {
		
	}
};

(function($) {
	$.fn.bar = function(method) {
		var container, bar;
		var settings = {
			title : '',
			width : 0
		};
		var methods = {
			init : function(options) {
				options = options || {};
				
				$.extend(settings, options);
				
				container = $(this);
				bar = container.find('div:first');
				
				return container;
			},
			
			set : function(value, title) {
				title = title || value;
				
				return this.each(function() {
					container.attr('title', title);
					bar.width(value);
				});
			}
		};
		
		return this.each(function() {
			if (methods[method]) {
				return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
			}
			else if (typeof method == 'object' || !method) {
				return methods.init.apply(this, arguments);
			}
			else {
				$.error('Method <' + method + '> does not exists on jQuery.bar');
			}
		});
	};
	
	$.extend({
		bar : function(options) {
			var container, bar;
			
			options = options || {};
			container = $('<div>').addClass('statusbar');
			bar = $('<div>').appendTo(container);
			
			options.className && container.addClass(options.className);
			options.title && container.attr('title', options.title);
			options.width && bar.width(options.width);
			
			return container;
		}
	});
})(jQuery);